<?php
$topics = $db->getAll('SELECT * FROM '.$ecs->table('topic'));
$return = [];
if ($topics)
{
    foreach ($topics as $k => $topic)
    {
        $return[] = [
            'topic_id'      => $topic['topic_id'],
            'title'         => $topic['title'],
            'description'   => $topic['description'],
            'topic_img'     => API_DATA('PHOTO', $topic['topic_img'])
        ];
    }
}
return $return;
// foreach ($topics as $k => $topic)
// {
//     $tmp = unserialize($topic['data']);
//     //var_dump($tmp->default);
//     var_dump(explode('|', $tmp->default[0]));
// }
